

#include "mining_lib.h"

/*
int contine(int * vector, int dim_vector, int valoare);
-------------------------------------------------
Verifica daca o valoare este continuta intr-un vector
-------------------------------------------------
long * vector;
long dim_vector;
long valoare;
return int 1 daca este continuta, 0 altfel
*/
int contine(long * vector, long dim_vector, long valoare)
{
	long i;
	for ( i = 0; i < dim_vector ; i++)
		if(vector[i] == valoare)
			return 1;
	return 0;
}

/*
minim de contor valori
*/
long mini ( long nr1,long nr2)
{
	if(nr1>nr2)
		return nr1;
	else
		return nr2;
}



/*
-------------------------------------------------
Permutari de n
-------------------------------------------------
*/
int Permutari(int n)
{
	if ( n == 0)
		return 1;
	else
		return n * Permutari(n-1);
}

/*
-------------------------------------------------
Aranjamente de n luate cate k
-------------------------------------------------
*/
int Aranjamente(int n, int k)
{
	int aranjamente = 0;
	aranjamente = Permutari(n)/ Permutari(n-k);
	return aranjamente;
}


/*
-------------------------------------------------
Combinari de n luate cate k
-------------------------------------------------
*/
int Combinari(int n, int k)
{
	return Aranjamente(n,k) / Permutari (k);
	
}

